/**
 * Created by wxbing (wxbing000@163.com) on 2021/7/28.
 */
function pick() {
    const p = new Promise((resolve, reject) => {
        setTimeout(() => {
            console.log('挑拣完成', new Date());
            resolve();
        }, 500);
    });
    return p;
}

function groundMouth() {
    const p = new Promise((resolve, reject) => {
        setTimeout(() => {
            console.log('磨口完成', new Date());
            resolve();
        }, 400);
    });
    return p;
}

function blow() {
    const p = new Promise((resolve, reject) => {
        setTimeout(() => {
            console.log('吹气完成', new Date());
            resolve();
        }, 300);
    });
    return p;
}

function PEbag() {
    const p = new Promise((resolve, reject) => {
        setTimeout(() => {
            console.log('已套PE袋', new Date());
            resolve();
        }, 200);
    });
    return p;
}

function pack() {
    const p = new Promise((resolve, reject) => {
        setTimeout(() => {
            console.log('装箱结束', new Date());
            resolve();
        }, 100);
    });
    return p;
}

pick()
    .then(function (data) {
        return groundMouth();
    })
    .then(function (data) {
        return blow();
    })
    .then(function (data) {
        return PEbag();
    })
    .then(function (data) {
        return pack();
    })
